from django.core.mail import send_mail

from celery_tasks.main import celery_app
from meiduo_mall.settings import HTML_MESSAGE, EMAIL_FROM


@celery_app.task
def send_verify_email(to_email, verify_url):
    html_message = HTML_MESSAGE.format(to_email=to_email, verify_url=verify_url)
    send_mail(subject='美多商城激活邮件',
              message="",
              from_email=EMAIL_FROM,
              recipient_list=[to_email],
              html_message=html_message)
